package com.lkm.market2_0.netapi;

import com.lkm.frame.task.StopAble;
import com.lkm.javatool.ServerTimeSync;
import com.lkm.javatool.lang.NameValueP;
import com.lkm.market2_0java.help.GsonHelp;

import java.util.List;
import java.util.Map;



public class AppApi {




    

    public static String regBalanceTask(String oid, String ukey,Map<String, Object> stringStringMap, StopAble sa) {

        String re = getString(oid,ukey,"http://zhongzi.web.ic1986.com/api/v1/balance/manufacturers_balance", new NameValueP[]{

        }, stringStringMap, sa);
        return re;
    }




//        String ukey = RunTimeData.steelyardInfo == null ? "" : RunTimeData.steelyardInfo.getSteelyardMac();
//        String re = getString( "http://zhongzi.web.ic1986.com/api/v1/balance/balance_print", new NameValueP[]{







    

    public static String upSteelyardRegTask(String oid, String ukey,Map<String, Object> stringStringMap, StopAble sa) {
//        boolean hasreg = MyApplication.getInstance().getSharedPreferences("settingapp", Context.MODE_PRIVATE).getBoolean("device_hasReg",false);
        if(stringStringMap!=null){
            stringStringMap.put("status", 0);
        }

        String re = getString(oid,ukey,"http://zhongzi.web.ic1986.com/api/v1/balance/balance_info", new NameValueP[]{

        }, stringStringMap, sa);
        return re;
    }



    public static String getString(String oid, String ukey, String url, NameValueP[] params, Map<String, Object> stringStringMap, StopAble sa) {

        String content = stringStringMap == null ? "{}" : GsonHelp.toJson(stringStringMap);

//        String oid = RunTimeData.steelyardInfo == null ? "" : "" + RunTimeData.steelyardInfo.getOrg();
//        String ukey = RunTimeData.steelyardInfo == null ? "" : RunTimeData.steelyardInfo.getSteelyardMac();
        NameValueP[] heads = new NameValueP[]{
                new NameValueP("oid", oid),
                new NameValueP("ukey", ukey),
                new NameValueP("hostapi", Api.host)
        };

        String re = AppHttpRequest.getString(url, params, content, heads, sa);
        return re;
    }



}
